package cn.iocoder.yudao.module.system.controller.admin.mini.goodInfo.discount;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.controller.admin.mini.goodInfo.discount.mapper.DiscountMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

//折扣表
@RestController
@RequestMapping("/qd/discount")
public class DiscountController {

    @Resource
    DiscountMapper discountMapper;

    @GetMapping("selectAll")
    public CommonResult selectall(){
        return CommonResult.success(discountMapper.selectList(new LambdaQueryWrapper<>()));
    }

    @PutMapping("update")
    public CommonResult update(@RequestBody DiscountDO dto){
        discountMapper.updateById(dto);
        return CommonResult.success("");
    }


}
